﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sgr.Licence
{
    /// <summary>
    /// 激活码系统常量定义
    /// </summary>
    public static class LicenseConstants
    {
        /// <summary>
        /// 许可证系统基准时间
        /// </summary>
        public static readonly DateTime BenchmarkDate = new DateTime(2000, 1, 1, 1, 1, 1, DateTimeKind.Utc);

        /// <summary>
        /// 激活码字段分隔符
        /// </summary>
        public const char FieldSeparator = '^';

        /// <summary>
        /// 时间戳精度（移除的末尾位数）
        /// </summary>
        public const int TimestampPrecision = 4;

        /// <summary>
        /// 激活码字段数量
        /// </summary>
        public const int FieldCount = 5;

        /// <summary>
        /// 激活码版本号
        /// </summary>
        public const string Version = "1.0";

        /// <summary>
        /// 许可证文件名
        /// </summary>
        public const string LicenseFileName = "sgr-app.lic";

        /// <summary>
        /// 临时文件名，用于存储访问时间记录
        /// </summary>
        public const string TempFileName = "lm.tmp";

        /// <summary>
        /// 注册码分隔符
        /// </summary>
        public const char RegistrationCodeSeparator = '-';

        /// <summary>
        /// 注册码每段长度
        /// </summary>
        public const int RegistrationCodeSegmentLength = 5;

        /// <summary>
        /// 缓存过期时间（小时）
        /// </summary>
        public const int CacheExpiryHours = 1;

        /// <summary>
        /// 刷新间隔时间（小时）
        /// </summary>
        public const int RefreshIntervalHours = 1;

        /// <summary>
        /// 许可证到期警告天数
        /// </summary>
        public const int LicenseWarningDays = 15;

        /// <summary>
        /// 校验和长度
        /// </summary>
        public const int ChecksumLength = 8;
    }
}